﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Paltop_v0._1.Entities;

namespace WebApplication13
{
    public partial class WebForm6 : System.Web.UI.Page
    {
        public List<String> data = new List<string>();
        public List<String> data2 = new List<string>();
        public List<String> data3 = new List<string>();
        
        private List<Os> OSNames = (List<Os>)HttpContext.Current.Application["osTypes"];
        private List<Browser> BrowserNames = (List<Browser>)HttpContext.Current.Application["browserTypes"];
        private List<Resolution> ResolutionNames = (List<Resolution>)HttpContext.Current.Application["resTypes"];
        protected void Page_Load(object sender, EventArgs e)
        {
            Paltop_.Controllers.UserlogController a = new Paltop_.Controllers.UserlogController();
            var t = a.osCounter();
            int id = Convert.ToInt32(HttpContext.Current.Session["ACCOUNTID"].ToString());
            foreach (var item in t)
            {
                Os Oss = OSNames.Where(p => p.OSID == item.Key).First();
                data.Add("["+"\'"+Oss.OSName+"\',"+item.Value+"]");
            }

            var t2 = a.browserCounter();

            foreach (var item in t2)
            {
                Browser Brws = BrowserNames.Where(p => p.BrowserID == item.Key).First();
                data2.Add("[" + "\'" + Brws.BrowserName + "\'," + item.Value + "]");
            }

            var t3 = a.resolutionCounter();

            foreach (var item in t3)
            {
                Resolution rso = ResolutionNames.Where(p => p.ResolutionID == item.Key).First();
                data3.Add("[" + "\'" + rso.ResoluationName + "\'," + item.Value + "]");
            }
       
        }
    }
}